﻿#ifndef APPMONITOR_H
#define APPMONITOR_H

#include <QString>
#include "common.h"
#include "Logger.h"


typedef enum
{
    MonitorType_pid,
    MonitorType_appName,
    MonitorType_listenSocket,
} MonitorType;

class AppMonitor
{
public:
    AppMonitor();
    AppMonitor(long id, QString & name, QString & startCmd, int monitorType, QString &cfgInfo, int checkIntervalSeconds, int maxMemLimitKB);
    QString getTypeName();

    QString getWorkPath();

    long id = -1;
    QString cfgInfo;
    QString name;
    QString startCmd;
    int type = MonitorType_pid;
    int checkIntervalSeconds;
    int stopFlag = 0;
    int maxMemLimitKB = -1; //-1消耗的最多的内存，如果超过，强杀并重新拉起程序
};

#endif // APPMONITOR_H
